﻿using PComponent.utility.sharedprop;
using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

namespace SharedPropTest2
{
    public class TestClass1:INotifyPropertyChanged
    {
        public RemoteProp<int> TestNumber = new RemoteProp<int>("TestNumber");

        int _sum = 0;
        public int sum
        {

            get{ return _sum;}
            set{
                
                if(_sum!=value ){
                    _sum = value;
                    if(PropertyChanged!=null)
                        PropertyChanged(this, new PropertyChangedEventArgs("sum"));
                }

            
            }
        }

        public TestClass1() {


            TestNumber.onChange = (rp) => sum = TestNumber.value + 5;
            sum = TestNumber.value + 5;

        }



        public event PropertyChangedEventHandler PropertyChanged;
    }
}
